package com.itheima.idea;

public class Demo3 {
    public static void main(String[] args) {

        int[][] arr ={{1,2,3,4,5,6},{7,8,9,10,11},{12,13,14,45,46,47,48,49}};
        int max=arr[0][0];
        int sum =0;
        for (int i = 0; i < arr.length; i++) {
            for(int j=0;j <arr[i].length;j++){
                sum+=arr[i][j];
                System.out.println(arr[i][j]);
                if(max<arr[i][j]){
                    max=arr[i][j];
                }
            }
        }
        System.out.println("数组最大值为:"+max);
        System.out.println("数组的和值为:"+sum);
    }
}
